package wrs.hcs.functions;

import org.openqa.selenium.WebDriver;

public class AdminConsole_Single {
	
	static
	AdminConsole ac = new AdminConsole();
	Miscellaneous m = new Miscellaneous();
	AdminConsole_Tracker act = new AdminConsole_Tracker();
	
	public void admin(WebDriver driver, String pin, String type){
		ac.wellness_search_it(driver, pin, "", "");
		ac.get_status_and_click(driver, pin, true);
		ac.update_online_single_in_admin(driver, type);
		ac.wellness_search_it(driver, pin, "", "");
		ac.get_status_and_click(driver, pin, false);
		String text = m.set_dropdown_to_hcs("online");
		ac.select_dropdown_to_hcs(driver, text, "single");
		ac.display_message_to_hcs(driver);
		ac.wellness_search_it(driver, pin, "", "");
		ac.get_status_and_click(driver, pin, false);
	}
	
	public void addon(WebDriver driver, String pin, String type){
		ac.wellness_search_it(driver, pin, "", "");
		ac.get_status_and_click(driver, pin, true);
		ac.create_addon(driver, "online", "single");
		ac.update_online_single_in_admin(driver, type);
		ac.wellness_search_it(driver, pin, "", "");
		ac.get_status_and_click(driver, pin, false);
		ac.table_validation(driver, "single_online", type);
		String text = m.set_dropdown_to_hcs("online");
		ac.select_dropdown_to_hcs(driver, text, "single");
		ac.display_message_to_hcs(driver);
		ac.wellness_search_it(driver, pin, "", "");
		ac.get_status_and_click(driver, pin, false);
	}
	
	public void sep(WebDriver driver, String pin, String type) throws Exception{
		ac.wellness_search_it(driver, pin, "", "");
		ac.get_status_and_click(driver, pin, true);
		Thread.sleep(20000);
		ac.header_patient_information(driver, true, true, true);
		ac.update_online_single_in_admin(driver, type);
		ac.wellness_search_it(driver, pin, "", "");
		ac.get_status_and_click(driver, pin, false);
		ac.check_patient_name_if_ends_at_sep(driver);
		String text = m.set_dropdown_to_hcs("online");
		ac.select_dropdown_to_hcs(driver, text, "single");
		ac.display_message_to_hcs(driver);
		ac.wellness_search_it(driver, pin, "", "");
		ac.get_status_and_click(driver, pin, false);
		act.goto_result_tracker(driver);
		act.tracker(driver, pin);
	}
	
	public void cancelReactivate(WebDriver driver, String pin) throws Exception{
		
		ac.wellness_search_it(driver, pin, "", "");
		ac.get_status_and_click(driver, pin, false);
		String text = m.set_dropdown_to_hcs("cancel");
		ac.select_dropdown_to_hcs(driver, text, "single");
		Thread.sleep(10000);
		ac.wellness_search_it(driver, pin, "", "");
		ac.get_status_and_click(driver, pin, false);
		text = m.set_dropdown_to_hcs("reactivate");
		ac.select_dropdown_to_hcs(driver, text, "single");
		Thread.sleep(10000);
		ac.wellness_search_it(driver, pin, "", "");
		ac.get_status_and_click(driver, pin, false);
		
		
	}
}
